<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

    <ui:composition template="template.xhtml">
        <ui:define name="content">

            <h:form>
                <rich:panel >
                    <f:facet name="header" >
                        <h:panelGroup>
                            <h:outputText value="Documentos" />
                            <a4j:status>
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ai.gif" alt="ai" style="height:12px;width:12px;"/>
                                </f:facet>
                            </a4j:status>
                        </h:panelGroup>
                    </f:facet>
                    <h:panelGrid columns="3" >


                        <h:outputText value="Nome:" />
                        <h:inputText value="#{DocumentoController.documento.usuario}" id="usuario">
                        </h:inputText>
                        <rich:message for="usuario" />
                        <h:outputText value="Login" />
                        <h:inputText value="#{DocumentoController.documento.documento}" id="documento">
                        </h:inputText>
                        <rich:message for="documento" />


</h:panelGrid>
</rich:panel>
           
            <rich:panel>
            
                <h:panelGrid columns="3" >

                    <h3 align="letf"><span>Upload de Arquivos</span></h3>
                    <br/>

                    <table align="left">
                        <tr>
                            <td>
                                <rich:fileUpload fileUploadListener="#{DocumentoController.upload}" maxFilesQuantity="5" addControlLabel="Adicionar" clearAllControlLabel="Limpar tudo"
                                                 clearControlLabel="limpar" stopEntryControlLabel="Parar" uploadControlLabel="Enviar"
                                                 doneLabel="Arquivo enviado!">
                                    <f:facet name="label">
                                        <h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />
                                    </f:facet>
                                </rich:fileUpload>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <img onclick="history.go(-1)" style="cursor: pointer"/>
                            </td>
                        </tr>
                    </table>

                    <br/>
                    <a4j:commandButton value="Inserir Novo Documento"
                                       action="#{DocumentoController.inserirDocumento}" />


                    <br/>
                    </h:panelGrid>
</rich:panel>
            </h:form>
                

        </ui:define>
    </ui:composition>
</html>